<template>
  <div>
    ta
  </div>
</template>

<script>
import VueCookies from "vue-cookies";

export default {
  name: "ta",
  /**
   * 防止强制输入路由路径访问
   */
  beforeRouteEnter(from, to, next) {
    if (to.name != null) { // 当不是强制路由，而是由页面跳转来时，允许跳转
      next()
    } else {// 否则进行检查
      if (VueCookies.get("role") !== "ta" && VueCookies.get("role") !== 'test') {
        next("/");
      }
      else{
        next()
      }

    }
  },
  data() {
    return {}
  }
}
</script>

<style scoped>

</style>
